//
//  MessageView.h
//  blipTest
//
//  Created by dawid on 08-12-17.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "TextViewLinked.h"
#import "ClickableNSImageView.h"
#import "NSAttributedString+AppKitExtensions.h"

#define descriptionFontColor 0.6353
#define shadowColor 0.2314
#define FONT_SIZING_OFFSET 50.0
#define USER_ACTION_ICON_Y 78.0

#define USER_AVATAR_Y  16.0
#define USER_AVATAR_X 8.0
#define USER_PICTURE_Y 0.0

#define USER_MSG_TEXT_X 63.0
#define USER_MSG_TEXT_Y 13.0
#define USER_MSG_TEXT_WIDTH_NO_PICT 260.0
#define USER_MSG_TEXT_WIDTH_WITH_PICT 195.0
#define USER_BACKGROUND_Y 7.0

extern NSString* const ABL_ReplyClickedNotification;
extern NSString* const ABL_PictureClickedNotification;
extern NSString* const ABL_PictureMouseExitNotification;
extern NSString* const ABL_YoutubePictureClickedNotification;
@class BlipMessage;


@interface MessageView : NSView {
	BlipMessage *blipMsg;

	NSMutableDictionary *textAttributes;
	float opacity;
	BOOL replyIconRollover;
	BOOL pictureIconRollover;
	BOOL quoteIconRollover;
	NSRect replyIconRect;
	NSRect pictureIconRect;
	NSRect quoteIconRect;
	NSRect deleteIconRect;
	NSRect avatarRect;
	BOOL deleteIconRollover;
	TextViewLinked *textView;
	NSRect defaultFrame;
	NSRect nextFrame;
	NSRect userDescRect;
	ClickableNSImageView *avatarView;
	ClickableNSImageView *pictureView;
	ClickableNSImageView *quoteView;
	ClickableNSImageView *replyView;
	ClickableNSImageView *backgroundView;
	BOOL isYoutube2QtAvaible;
	NSString* descriptionText;
}
@property (readwrite)BOOL pictureIconRollover;
@property (readwrite)BOOL replyIconRollover;
@property (readwrite)BOOL quoteIconRollover;
@property (readwrite)BOOL deleteIconRollover;
@property (readwrite)NSRect replyIconRect;
@property (readwrite)NSRect pictureIconRect;
@property (readwrite)NSRect quoteIconRect;
@property (readwrite)NSRect deleteIconRect;
@property (readwrite)NSRect defaultFrame;
@property (readwrite)NSRect nextFrame;
@property (readwrite)float opacity;
@property (readwrite,assign) NSMutableDictionary* textAttributes;
@property (readwrite, assign) TextViewLinked* textView;
-(void)setBlipMsg:(BlipMessage*)msg;
-(BlipMessage*)blipMsg;

-(void)drawDescriptionStringInRect:(NSString*)string inRect:(NSRect)r;
-(NSImage*)maskedAvatar:(NSString*)avatarPath;
-(void)setAvatarView;
-(void)setPictureView:(NSData*)pictureData;
-(void)setIconsView;
-(void)setBackgroundView;
-(BOOL)incFontSize;
-(BOOL)decFontSize;

+(NSSize)iconDefaultSize;
+(NSSize)backgroundDefaultSize;
+ (NSImage *)rotateIndividualImage: (NSImage *)image clockwise: (BOOL)clockwise rotateBy:(int)degrees;
+(NSImage*)quoteButton;
+(NSImage*)quoteButtonRollover;
+(NSImage*)replyButton;
+(NSImage*)replyButtonRollover;
+(NSImage*)deleteButton;
+(NSImage*)deleteButtonRollover;
+(NSImage*)pictureButton;
+(NSMutableDictionary*)blipDescriptionTextAttributes;
+(NSMutableDictionary*)blipTextAttributes;
+(NSImage*)avatarMask;
+(NSSize)avatarDefaultSize;
+(NSSize)avatarSmallDefaultSize;
@end
